<script lang="ts">
export default {
name: "Login",
  methods:{
    fn(){
      this.$router.push({
        path:'/login',
        query:{
          num :1
        }
      })
    }
  },
  beforeRouteEnter(to,from,next){
    console.log('组件内部beforeRouteEnter');
    next();
  },
  beforeRouteUpdate(to,from,next){
    console.log('组件内部beforeRouteUpdate');
    next();
  },
  beforeRouteLeave(to,from,next){
    console.log('组件内部beforeRouteLeave');
    next();
  }
}
</script>

<template>
  <div>
    <h3>login</h3>
    <button @click="fn">点我</button>
    <router-link to="/home">首页</router-link>
  </div>

</template>

<style scoped lang="less">

</style>
